<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>歌曲评论页</title>
</head>
<body>
	<div>
		<h3>发布评论</h3>
		<form action="" method="post">
		{% csrf_token %}
		<textarea name="comment"></textarea>
		<input type="submit" name="发布">
		</form>

	</div>
	<div>
		<h3>评论板块</h3>
		<div>
		{% for item in contacts %}  <!-- 这里修改为 contacts -->
           
                <div>
                    <h3>内容：</h3>
                    {{ item.Comment_text}}
                </div>
                <ul>
                    <li>用户名：<span>{{ item.Comment_user }}</span></li>
                    <li>日期：<span>{{ item.Comment_date}}</span></li>
                </ul>
            
        {% endfor %}

			<div>
				{% if contacts.has_previous %}
				<a href="{% url 'music:comment' song_id  %}?page={{ contacts.previous_page_number }}" target="_self">上页</a>
				{% endif %}

				<span>当前第{{ contacts.number }}页</span>

				{% if contacts.has_next %}
					<a href="{% url 'music:comment' song_id  %}?page={{ contacts.next_page_number }}" target="_self">下页</a>
				{% endif %}
			</div>
		</div>
</body>
</html>